UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xrTG+0hR/2JVF/zlmqnq944nYO/bvhYxjrzKhm8pJeg=' 
WHERE 
  key_id = '601e3dd5212572494ea4ece2d794ec3d124398369769237fb490e245a8b297da' 
  AND (
    token = 'xrTG+0hR/2JVF/zlmqnq944nYO/bvhYxjrzKhm8pJeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039