UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Ezs2jckph6jtYE1LZe6ANRXkHII/Tn0GXe/aetC05M=' 
WHERE 
  key_id = 'fad29e65ab518a8173d9296a2ad74bb083b6bdfecb2376e8bba49d7a74f518b6' 
  AND (
    token = '7Ezs2jckph6jtYE1LZe6ANRXkHII/Tn0GXe/aetC05M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036