UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zR1+uFD4REuHbfuVKVINaCMuNYOTOiMrZTl7W7GYs6U='
WHERE
key_id = '6fbadb47ddfaad73848359b90ca5b52ce3d4ac5fbffdfac7e1489f16f2ccc9c0'
AND (
token = 'zR1+uFD4REuHbfuVKVINaCMuNYOTOiMrZTl7W7GYs6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)