UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zidounbWagPAbTtxlfyC+LnbR4P+Al/xXgaqP9vFSCU=' 
WHERE 
  key_id = 'e94e048ab66b407390ce115c2bbbc9b6be7ce490de0e12417a946fa52810ea8b' 
  AND (
    token = 'zidounbWagPAbTtxlfyC+LnbR4P+Al/xXgaqP9vFSCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022