UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZbP2L/4VYG15ZH5CYQsb7CZmR+m9THv4qCN5wup2+eY='
WHERE
key_id = '0c5b95eb5eb612df850b774f80e69940904e3cf4251eb1a6d1346cee707cd96d'
AND (
token = 'ZbP2L/4VYG15ZH5CYQsb7CZmR+m9THv4qCN5wup2+eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)