UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '77+7dF9Z2go7DgtZQUnVl02KB2+33F1rPAxRLQZYm20='
WHERE
key_id = '74973590e15b106a11bd540eba331b5cb52fdf8f3d729dd2be07f169d4fe795e'
AND (
token = '77+7dF9Z2go7DgtZQUnVl02KB2+33F1rPAxRLQZYm20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)