UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wsZw698rcPSZ9MsDBbtht1QrxvJIlbWf//qYoB8hT5M=' 
WHERE 
  key_id = '2b4b0e0fe50197bf9b2b89f385e2d57823d211eebd22108b584f7be564e01478' 
  AND (
    token = 'wsZw698rcPSZ9MsDBbtht1QrxvJIlbWf//qYoB8hT5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045