UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Mdt5Bwy1bxcwRi9/C3yf+Vm/xcVFwnNf7XWG+ZJ6Mo='
WHERE
key_id = 'db1ad172037117b3284104eb45f407ef08152b09966e2870c68cdf37e74308b0'
AND (
token = '7Mdt5Bwy1bxcwRi9/C3yf+Vm/xcVFwnNf7XWG+ZJ6Mo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)