UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3p12b0B36GOZBkV6T4u+En2KF9wI+r/6FW0NcrUYRgQ=' 
WHERE 
  key_id = '3d32cba06779e4b9622220f7bb03ad175864e2d380e8abc65f3be156d93d9f52' 
  AND (
    token = '3p12b0B36GOZBkV6T4u+En2KF9wI+r/6FW0NcrUYRgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031