UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32BY01IYOvuCPccjYHK3Yam0IEZ8OGEVinrQ7/J4CHE='
WHERE
key_id = 'c93860fd6bdd3fcb5ae03ea93a2b39679f23d297631240df12a223698e68345b'
AND (
token = '32BY01IYOvuCPccjYHK3Yam0IEZ8OGEVinrQ7/J4CHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)