UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OH+hmlb0j+QwLiqpqsrw7I4vPrA4s5pvfH5iG295+34='
WHERE
key_id = '802c0fa111e46cb40c1995d38da2bb7f37e5c7440f44ffb32ce5a8213959bc4e'
AND (
token = 'OH+hmlb0j+QwLiqpqsrw7I4vPrA4s5pvfH5iG295+34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)