UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iFW8WtbBgQL75Gkkv8pLP4E9onZebQ8RfqEzceV0D2M=' 
WHERE 
  key_id = '6411869d953472568a56c68e3c677233687598702466a094add688a6342e4f0b' 
  AND (
    token = 'iFW8WtbBgQL75Gkkv8pLP4E9onZebQ8RfqEzceV0D2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039