UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oOOo283itrAnx73SxsOMVYpOIwTlh3zYw2FL4Dz30KU='
WHERE
key_id = '8856194c9d63cef7155cd62351d5a2f93bdc94ba26272174f54faa99576f9c10'
AND (
token = 'oOOo283itrAnx73SxsOMVYpOIwTlh3zYw2FL4Dz30KU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)