UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UPdmj8FTPMRpEK9hR9zFDnymXNKyKm1HQclDAPKoMh4=' 
WHERE 
  key_id = 'eb71f9a73b9eff0b85642789aa79f9cc68bbbd665a1d66e5f342ecfd9601c9fc' 
  AND (
    token = 'UPdmj8FTPMRpEK9hR9zFDnymXNKyKm1HQclDAPKoMh4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031