UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ke5CUP/xAT3ECY3PI2kK8511n4HZJCfrIB7wDLN9Z2M=' 
WHERE 
  key_id = 'cc7dbb4b1593abab68d8672905f0aac94595b9e431885551c6ae452d988f0b5f' 
  AND (
    token = 'Ke5CUP/xAT3ECY3PI2kK8511n4HZJCfrIB7wDLN9Z2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037