UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YXljg4CH+ovEfsH33uw5azF+183XK/mqZ2ln7FloS3o='
WHERE
key_id = 'c97cf48c9e110a6b1e870257c483e00ebbdf537287b5c44a16e9769bdb38c8e2'
AND (
token = 'YXljg4CH+ovEfsH33uw5azF+183XK/mqZ2ln7FloS3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)