UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T1hnVMS8fRRJU5MbBwlWSLYfF9AMbSzwm+VuR3vVsJA='
WHERE
key_id = 'b118f4e499468228db35e4b8a5e3c8623572506cc480b7ad6a776f7316c3560c'
AND (
token = 'T1hnVMS8fRRJU5MbBwlWSLYfF9AMbSzwm+VuR3vVsJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)