UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wzBV/AwK1+VYqSoO0vk7Rq+yqlgmSL5nvRpkHaND2To='
WHERE
key_id = 'f2522949553128a7cb76148d5fc0c2efad7fa3560bf9e87637aa4faf5bedf9ff'
AND (
token = 'wzBV/AwK1+VYqSoO0vk7Rq+yqlgmSL5nvRpkHaND2To='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)