UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PDh92VkbWGCo6Y5Uz5ozM+EnTlOt4EO2oNOd5nVtE24='
WHERE
key_id = '9a99f06227c8249a83de725fa7c87bc6d31a70fb6243465b522786dcf88c7b15'
AND (
token = 'PDh92VkbWGCo6Y5Uz5ozM+EnTlOt4EO2oNOd5nVtE24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)