UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZQwjGgTQu9x44tZw24hWirXDGnfrOX8sTb2jO3KF7Y='
WHERE
key_id = 'a20fe2aa66c527ef7cd99a265c232930db675732413af4f6fb06bded6d546d04'
AND (
token = 'yZQwjGgTQu9x44tZw24hWirXDGnfrOX8sTb2jO3KF7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)