UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IHFDgKCjxWJ8zEdUMGJAk8LsIfTn384Er70pIa+45qA=' 
WHERE 
  key_id = '3c6c0665f9fb82cb81330793c766779c7759daa2a243c65f42ab8537e49e0a2e' 
  AND (
    token = 'IHFDgKCjxWJ8zEdUMGJAk8LsIfTn384Er70pIa+45qA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031