UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hHnDCNA9KDiXR+SqTuKJM+FwmB2yzghPyNhPn6+CL2o='
WHERE
key_id = '5eb56d88908170d42da0a76487923b69551797d0bcae3d37badffc9858076fdd'
AND (
token = 'hHnDCNA9KDiXR+SqTuKJM+FwmB2yzghPyNhPn6+CL2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)