UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y6z8xiU7rR5XxqTN4NSSoGEh0HIz2GWotgUZSanQ69A='
WHERE
key_id = '4bb9596233f641d130c3c5dc868ac5c9ea838c4ef2afc398796d720369129c76'
AND (
token = 'Y6z8xiU7rR5XxqTN4NSSoGEh0HIz2GWotgUZSanQ69A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)