UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5uctkVBZiUaGyOPvXuW4K9NBRdb7PQ41gwFbbD+GBH8=' 
WHERE 
  key_id = '86ba54dfc78520d235da14a1b90a7c6b996108725afc6f621934e3e1b9ee497f' 
  AND (
    token = '5uctkVBZiUaGyOPvXuW4K9NBRdb7PQ41gwFbbD+GBH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038