UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RIRuDpgDatcdOReBM/XLm8RpQ/PHS/HTMXMvvc0J5ds=' 
WHERE 
  key_id = 'ab0d034ed993e88aa6fd734cb96fa180c5cf7df799a93b6b74f7ebcfb7c5c758' 
  AND (
    token = 'RIRuDpgDatcdOReBM/XLm8RpQ/PHS/HTMXMvvc0J5ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034