UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iuyx1C0N0Hn/c5NU52icZXreWJrfMDKXslBOPY2a0TA=' 
WHERE 
  key_id = 'cf097e266ea89cd684a2834ccf7b4c530f6866c87e9daa34b5bb1709357b84c9' 
  AND (
    token = 'iuyx1C0N0Hn/c5NU52icZXreWJrfMDKXslBOPY2a0TA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042