UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EqEKzyveXXlcxjL4Vbs9/hIHSppFOrGBRhtnwy6zXj4=' 
WHERE 
  key_id = '3db02054121698a55fc31fcc5a39697435fd3bdcfce070fcd9fe6e2eda86c16e' 
  AND (
    token = 'EqEKzyveXXlcxjL4Vbs9/hIHSppFOrGBRhtnwy6zXj4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051