UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1nIOhQyo/4GzB8uW7nC3QBE0wCyeK7gWyWxGl1cCXfI='
WHERE
key_id = '2cf1924eabee3b16d565428c3c6d07c2057d130251a6baa5dd152f1a29b8e54c'
AND (
token = '1nIOhQyo/4GzB8uW7nC3QBE0wCyeK7gWyWxGl1cCXfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)