UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hDsg6lgD+3JeMzZThIbsM/DW3qvit2I/MfeyxsoAYV4=' 
WHERE 
  key_id = '6910e27be6d4d36bf8197e86bc8c3d90eea7959d1ab018e096499ea65773a6e5' 
  AND (
    token = 'hDsg6lgD+3JeMzZThIbsM/DW3qvit2I/MfeyxsoAYV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023