UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '606F1c3vTvxJP+7sMV58Lv4XJ18AmlEoVF0+d/Qn5Rg='
WHERE
key_id = '492ec35361026d6bc1172075cb888b72c431ab70de2c48e2a0fef048d6c9d17c'
AND (
token = '606F1c3vTvxJP+7sMV58Lv4XJ18AmlEoVF0+d/Qn5Rg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)