UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '22g9Gxs/u+4JjZ64UhYBjDl/7YjhwMJHPPLBbNUeFy8=' 
WHERE 
  key_id = '62135bfd06f70cc5c5a83566ba48bc4818c3b288a41547a41f99fba0774e5922' 
  AND (
    token = '22g9Gxs/u+4JjZ64UhYBjDl/7YjhwMJHPPLBbNUeFy8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043