UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'siwDDAbeMEmUdUB/E9F4azcYx0Vn8StEqzl2S4Nf4Vw='
WHERE
key_id = '47428d2104c0c0f72d55ac042f0c4f7cd654434d96d567bcc3c59ada456a35db'
AND (
token = 'siwDDAbeMEmUdUB/E9F4azcYx0Vn8StEqzl2S4Nf4Vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)