UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VWcIiNl1LJwGRoaFE6p+mIeZLFoZQHD3ssfvJV/cbWw='
WHERE
key_id = '1c8bbedc1e74c5bc812ac38988714b4579046fcc81e6ac9bdc44158f8bc37fe2'
AND (
token = 'VWcIiNl1LJwGRoaFE6p+mIeZLFoZQHD3ssfvJV/cbWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)