UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GQw8q44H8EmKR/OlLR7BEkHdwRGAA6u8WeejtrFSLj4='
WHERE
key_id = '204b59287b4e403a6df12eb2395559202189472c49eb73eef4d1e876f9a6b322'
AND (
token = 'GQw8q44H8EmKR/OlLR7BEkHdwRGAA6u8WeejtrFSLj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)