UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bz7bkJRmDTWipu2NBYFdyHL2uxfw/l6HqyhBHHReee0='
WHERE
key_id = '806a86e6e5f956c0b5870b25bae8c8fa87fc3126c63f955477e6a2e2424732b5'
AND (
token = 'Bz7bkJRmDTWipu2NBYFdyHL2uxfw/l6HqyhBHHReee0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)