UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M4ZHGag+QYIdqDf3qQGWqZV0BD6u9AtR5LyLFYvYXz0='
WHERE
key_id = '5db1c251923f8eee859dd9a07502a603877068c723b9425f1cb1bc24e1237ae6'
AND (
token = 'M4ZHGag+QYIdqDf3qQGWqZV0BD6u9AtR5LyLFYvYXz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)