UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1W/fHT5+wPYwEErGMKHmBXMCn/xnzmJY2zmm7h/6W+4='
WHERE
key_id = '02b3812e2cdb78e2ced83e68d2669712d12003158bef3e301da89fdb8ccde866'
AND (
token = '1W/fHT5+wPYwEErGMKHmBXMCn/xnzmJY2zmm7h/6W+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)