UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SaoZmQP+a1s38XAKq8ZPO4ItHWjF5HXYKcOLkFzTi2I='
WHERE
key_id = 'a1ac943400c6028c9cb7b2e8a3dc9c30f5dd2f24501932bbd1af7fa0baee1c31'
AND (
token = 'SaoZmQP+a1s38XAKq8ZPO4ItHWjF5HXYKcOLkFzTi2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)