UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZNhMDsCZ0yiUsDP9FSDdbiGoSxHqinHVlXKPcqjmrfM='
WHERE
key_id = '70bfa2c5eac8290abc159d08a6a0f939043e163e2f6f755ef4204597da5408b0'
AND (
token = 'ZNhMDsCZ0yiUsDP9FSDdbiGoSxHqinHVlXKPcqjmrfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)