UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3H+u0lZ0rjpXBuhtvb6JK790TfCfzuge2Z7wHZMDo/I='
WHERE
key_id = '3e7674edc70ae783fc2f7385e0b6dec0f2616e32bfcafb15af965015954ec342'
AND (
token = '3H+u0lZ0rjpXBuhtvb6JK790TfCfzuge2Z7wHZMDo/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)