UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pbJ37VVs6dO2Ds0W8nub9l+nGSY9FW7GwuX2/Oeh5Cw='
WHERE
key_id = '8b65858dc8ce3592fe6604f4fbf6d7cb376cd8220e96339598d6d2ffc14619f8'
AND (
token = 'pbJ37VVs6dO2Ds0W8nub9l+nGSY9FW7GwuX2/Oeh5Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)