UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8yiMeUm4c6G289NqOSp980CrdjZcri/5Hg0SJrAjrF4=' 
WHERE 
  key_id = 'c7786be52a83f086ff6e60830964fadac2fe1395f5e32db49cfc8dfef0c6b17c' 
  AND (
    token = '8yiMeUm4c6G289NqOSp980CrdjZcri/5Hg0SJrAjrF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019