UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NqJcbfAbWMx/6AXvCUSb+jFFe/GZbhgB111BCBWq41w='
WHERE
key_id = 'ee944277c025d68cb94b53d35237129bc7c3424133755e38310ae08d42789588'
AND (
token = 'NqJcbfAbWMx/6AXvCUSb+jFFe/GZbhgB111BCBWq41w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)