UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4indG0MT6mWeY/wTUhTzKV2BTBVZgm1WWMhEHXCITU='
WHERE
key_id = 'e97203e2192ee74bd6573a93269f2e3802b624195a7596e37155c46ac7ba14dd'
AND (
token = 's4indG0MT6mWeY/wTUhTzKV2BTBVZgm1WWMhEHXCITU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)