UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u5lbcAyd4UEmOAs6NdziZXCfqDwuy4E+BC0nRGh97bU='
WHERE
key_id = '887e47e238335a27c44a613b602dc3f5406655bff01f13f99588a754eb6946e6'
AND (
token = 'u5lbcAyd4UEmOAs6NdziZXCfqDwuy4E+BC0nRGh97bU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)