UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PSksBkKcFt7HumMXi7vWpfV8Xdh8DUpYRBIKDXqrVR0=' 
WHERE 
  key_id = '3ebd03bab3b9d329e7f44ca36d9428d0cb3c03e0959bf7fa9c739eeb8973497f' 
  AND (
    token = 'PSksBkKcFt7HumMXi7vWpfV8Xdh8DUpYRBIKDXqrVR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025