UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oUnb/+DBTvr0735xneTQCJ8oU/ASnZMMe7gbhzqln2w='
WHERE
key_id = '88a852b74ebb8b0f2329b9d6c3c1f74bc1f103ea9d1899614f643375acbd6616'
AND (
token = 'oUnb/+DBTvr0735xneTQCJ8oU/ASnZMMe7gbhzqln2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)